cmake_minimum_required( VERSION 2.8 )
project(jizhi_gnis)

set( CMAKE_CXX_FLAGS "-std=c++14" )

set(CMAKE_C_FLAGS "-pthread -std=gnu99")
set(CMAKE_EXE_LINKER_FLAGS "-pthread")
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")

execute_process(COMMAND uname -m
        OUTPUT_VARIABLE DEVICE_SYSTEM_ID)
message(WARNING " device system id: ${DEVICE_SYSTEM_ID}")

if (DEVICE_SYSTEM_ID MATCHES x86_64)
    add_definitions(-DPLATFORM_ARCH_x86_64=1)
elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
    add_definitions(-DPLATFORM_ARCH_aarch64=1)
else ()
    message(FATAL_ERROR "FATAL: Please confirm your platform.")
endif ()



include_directories( 
	src
	src/circularBuf
	src/mountHaofu
	src/jizhiGnis
  )



add_library(circular_buf STATIC src/circularBuf/circular_buf.cpp)

add_executable(jizhi_gnis  	src/main.cpp
							src/mountHaofu/mount_haofu.cpp
							src/jizhiGnis/jizhi_gnis.cpp)


target_link_libraries(jizhi_gnis  circular_buf)

